package com.pig4cloud.pig.village.rules.service;

import java.util.List;

import com.pig4cloud.pig.village.api.entity.RewardEvent;
import com.pig4cloud.pig.village.api.entity.RewardInfo;
import com.pig4cloud.pig.village.api.entity.WelfareRule;
import com.pig4cloud.pig.village.rules.DataCollect;

/**
 * 两种规则触发方式：红黑榜事件，定时任务触发
 * @author limbray.li
 * @date 2021/7/22
 */
public interface IRuleService {
	Boolean dealRuleByEvent(Long eventId);

	Boolean dealRuleByEvent(RewardEvent event);

	Boolean dealRuleByEvent(RewardEvent event, RewardInfo info);

	Boolean dealRuleByEvent(DataCollect collect, RewardEvent event);

	/**
	 * 将规则保存到规则引擎中
	 * @param list
	 * @return
	 */
	Boolean saveRules(List<WelfareRule> list);

	Boolean initRulesEngine();

	String generateRule(WelfareRule welfareRule, String ruleName);
}
